package com.common.sp;

import com.orangelife.mobile.confirmOrder.entity.PaidInfo;

/**
 * Created by Administrator on 2016/7/25.
 */
public class PaySp {

    /** 支付密码状态 ,0(已设置,不需要处理) 1 未设置 2 冻结(不可能进入支付结果页) 4(不再设置) */
    public static void setNeverSetPayPwd(boolean isNeverSetPayPwd) {
        SharedPreferUtil.getInstance().putBoolean(SharedPreferUtil.APP_INFO, UserSp.getRegPhone() + "paypwd", isNeverSetPayPwd);
    }

    public static boolean isNeverSetPayPwd() {
        return SharedPreferUtil.getInstance().getBoolean(SharedPreferUtil.APP_INFO, UserSp.getRegPhone() + "paypwd", false);
    }

    public static void setWxAppID(String versionInfo) {
        SharedPreferUtil.getInstance().putString(SharedPreferUtil.APP_INFO, "payAppID", versionInfo);
    }

    public static String getWxAppID() {
        return SharedPreferUtil.getInstance().getString(SharedPreferUtil.APP_INFO, "payAppID", "");
    }

    public static void setPaidInfo(PaidInfo paidInfo) {
        SharedPreferUtil.getInstance().putString("payBtnText", paidInfo.getBtnText());
        SharedPreferUtil.getInstance().putString("payOrderInfo", paidInfo.getOrderInfo());
        SharedPreferUtil.getInstance().putString("payTotalPrice", paidInfo.getTotalPrice());
        SharedPreferUtil.getInstance().putString("payRepairID", paidInfo.getRepairID());
        SharedPreferUtil.getInstance().putString("payServiceOrderID", paidInfo.getServiceOrderID());
        SharedPreferUtil.getInstance().putString("payProductsID", String.valueOf(paidInfo.getProductsID()));
        SharedPreferUtil.getInstance().putString("payFeeType", String.valueOf(paidInfo.getFeeType()));
        SharedPreferUtil.getInstance().putString("payType", paidInfo.getType());
        SharedPreferUtil.getInstance().putString("payInfo", paidInfo.getPaidInfo());
        SharedPreferUtil.getInstance().putString("payError", paidInfo.getTvApliayTitle());
        SharedPreferUtil.getInstance().putBoolean("payIsSuccess", paidInfo.getIsSuccess());
    }

    public static String getProductID() {
        return SharedPreferUtil.getInstance().getString("payProductsID", "");
    }

    public static Boolean isSuccess() {
        return SharedPreferUtil.getInstance().getBoolean("payIsSuccess", false);
    }

    public static String getFeeType() {
        return SharedPreferUtil.getInstance().getString("payFeeType", "");
    }

    public static String getRepairID() {
        return SharedPreferUtil.getInstance().getString("payRepairID", "");
    }

    public static String getServiceOrderID() {
        return SharedPreferUtil.getInstance().getString("payServiceOrderID", "");
    }

    public static String getType() {
        return SharedPreferUtil.getInstance().getString("payType", "");
    }

    public static String getOrderInfo() {
        return SharedPreferUtil.getInstance().getString("payOrderInfo", "");
    }

    public static String getTotalPrice() {
        return SharedPreferUtil.getInstance().getString("payTotalPrice", "");
    }


    public static String getInfo() {
        return SharedPreferUtil.getInstance().getString("payInfo", "");
    }

    public static String getBtnText() {
        return SharedPreferUtil.getInstance().getString("payBtnText", "");
    }
}
